#ifndef TriangleRice_H
#define TriangleRice_H

#define ZERO_MEM(a) memset(a, 0, sizeof(a))

#define ARRAY_SIZE_IN_ELEMENTS(a) (sizeof(a)/sizeof(a[0]))

#ifdef WIN32
#define SNPRINTF _snprintf_s
#define RANDOM rand
#define SRANDOM srand((unsigned)time(NULL))
#else
#define SNPRINTF snprintf
#define RANDOM random
#define SRANDOM srandom(getpid())
#endif
#define INVALID_OGL_VALUE 0xFFFFFFFF

#define SAFE_DELETE(p) if (p) { delete p; p = NULL; }

#define GLExitIfError()                                                          \
{                                                                               \
	GLenum Error = glGetError();                                                \
	\
	if (Error != GL_NO_ERROR) {                                                 \
	printf("OpenGL error in %s:%d: 0x%x\n", __FILE__, __LINE__, Error);     \
	exit(0);                                                                \
	}                                                                           \
}

#define GLCheckError() (glGetError() == GL_NO_ERROR)

#include <stdio.h>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <stack>
#include <cctype>
#include <assert.h>

#include "math_3d.h"
#include "math_2d.h"
// include DevIL for image loading
#include <IL/il.h>

#include <GL/glew.h>
#include <GL/freeglut.h>

typedef unsigned int uint;
typedef unsigned short ushort;
typedef unsigned char uchar;
#endif

